package me.zhengjie.modules.system.service;

import me.zhengjie.modules.system.domain.Department;
import me.zhengjie.modules.system.service.dto.DepartmentDTO;
import me.zhengjie.modules.system.service.dto.DepartmentQueryCriteria;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
* @author Zhang xing wang
* @date 2020-03-26
*/
public interface DepartmentService {

    /**
    * 查询数据分页
    * @param criteria 条件参数
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(DepartmentQueryCriteria criteria, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<DepartmentDTO>
    */
    List<DepartmentDTO> queryAll(DepartmentQueryCriteria criteria);

    /**
     * 根据ID查询
     * @param id ID
     * @return DepartmentDTO
     */
    DepartmentDTO findById(String id);

    DepartmentDTO create(Department resources);

    void update(Department resources);

    void delete(String id);

    void download(List<DepartmentDTO> all, HttpServletResponse response) throws IOException;

    Map<String, Object> terrDepartment(List<DepartmentDTO> list);


}